An IDLnetOGCWMS object lets you access a Web Map Service (WMS) server that supports the Open Geospatial Consortium (OGC) standards. The OGC is an international group working to develop standards for the exchange of geospatial content and services including specifications for web delivery of data that combines location and geospatial information.
For additional information on IDL’s WMS features, see the following sections:
Note: A sample IDL program included in the IDL distribution provides a generic WMS browser that lets you peruse and request coverages from a remote OGC server. See Sample WMS Browser for details.
None
See IDLnetOGCWMS::Init.
Objects of this class have the following properties. See IDLnetOGCWMS Properties for details on individual properties.
|
This class has the following methods:
See the following methods for examples:
The IDL distribution includes a sample program that allows you to enter a working URL to an OGC server and then call GetCapabilities, GetMap and GetFeatureInfo from within the user interface. You can modify property values and query characteristics to return the desired data. To run the browser program, enter OGC_WMS at the command line. See the browser help for more information.
Tip: You can use the example IDL OGC WMS Browser as a template for creating an application that queries a remote WMS server. This example is located in the IDL_DIR\examples\ogc\wms directory where IDL_DIR is the directory where you have installed IDL. Running the example lets you parse a known, working URL to an OGC WMS server, and then make GetCapabilities, GetMap and GetFeatureInfo requests. By default, returned files are written to your application user directory, a subdirectory of your home directory.
6.4 |
Introduced |
A request for map data from an OGC WMS server involves three main requests: GetCapabilities, GetMap, and GetFeatureInfo. The following describes these operations in terms of the IDLnetOGCWMS object:
For details on how to use the IDLnetOGCWMS object properties and methods to request and receive information from an OGC server, see Making OGC WMS Server Requests. Also see Sample WMS Browser for information about the IDL OGC WMS Browser, a sample program included in the IDL distribution.
The Open Geospatial Consortium web site provides complete details on the Web Map Service protocol including the WMS specification and schema documents. You may find the following documents helpful if you need additional WMS resources. See OGC web site (www.opengeospatial.org) to search for these and other resource files.
Document |
Description |
Specification |
OGC Web Map Service, Version 1.1.1, OGC Web Map Service, Version 1.3.0, |
This object supports version 1.1.1 and 1.3.0 of the OGC WMS standard. The IDLnetOGCWMS object conforms to the OGC WMS standard and is designed to communicate with OGC WMS compliant servers.
Note: Since this object is designed as an OGC WMS client, OGC WMS certification is not applicable. Compliance testing and certification is valid only for WMS servers.
This section outlines the steps required to query and return information from an OGC server. The goal is to return one or more layers as a rendered image map file. Broadly, an information request from a WMS sever requires determining what data is available from a server (layers), determining what data you want to request (the layer definition), making the request, and returning rendered map data. You then have the option to request specific information about a map feature if desired and if supported by the server.
Note: You can implement a callback to return information about the status of requests. See Using Callbacks with the IDLnetOGCWMS Object for details.
After you create an IDLnetOGCWMS object, you will need to complete the following steps:
Identify the WMS server. The easiest way to do this is to pass a working URL to the IDLnetOGCWMS::ParseUrl method, which sets the required URL_HOSTNAME and URL_PATH properties. Alternately, manually set properties related to the URL. See Translating a URL into Property Values for information on which URL components belong to which IDLnetOGCWMS properties.
If dealing with secure WMS servers, see HTTP Authentication, Security and Encoding for additional information.
A valid WMS server URL is required to establish communication with an OGC WMS server. Additionally, IDLnetOGCWMS URL-related property values must be set before data can be successfully requested from a OGC WMS server. Either set the required properties manually (using SetProperty) or pass a URL to ParseURL. The IDLnetOGCWMS::ParseUrl method automatically parses a given URL and sets related property values.
Note: Regardless of how properties are set, the URL_HOSTNAME and URL_PATH properties must be set before calling the GetCapabilities, GetMap or GetFeatureInfo methods.
The following table describes how the components of a given URL should be assigned to property values. Consider the following URL (which would typically exist on a single line):
http://my.hostname.com:8080/demo/cgi_path?CustomPrefix&
Version=1.1.1&SERVICE=WMS&CustomMiddle&Request=GetCapabilities&
CustomSuffix
Components of this URL map to properties as follows.
Property |
Value |
http |
|
my.hostname.com |
|
8080 |
|
demo/cgi_path |
|
Version=1.1.1 (or 1.3.0 but defaults to 1.1.1) |
|
CustomPrefix&CustomMiddle |
|
CustomSuffix |
The query portion of the URL passed to a WMS server (the parameter=value pairs following the ? character) always includes the following three parameters:
These three parameters are inserted into the URL automatically by IDL; any values specified for these parameters in the URL are ignored. They are not included when the URL_QUERY_PREFIX or URL_QUERY_SUFFIX properties are returned by the GetProperty method. Any query parameters that precede any of the three required parameters will be included in the URL_QUERY_PREFIX property by the ParseURL method; other nonrequired parameters will be included in the URL_QUERY_SUFFIX property.
Note: If not specified in the URL, property values besides URL_HOSTNAME and URL_PATH are set to default values. For example, the URL_PORT property defaults to 80 and the WMS_VERSION defaults to 1.1.1.
Callbacks from the IDLnetOGCWMS object provide a way to transmit information back to the caller based on the status of a request made to a remote OGC WMS server. The value returned by the callback function is then used by the IDLnetOGCWMS object to determine whether to continue or abort the request.
The IDLnetOGCWMS object lets you define functions (written in IDL) that will be called during a GetCapabilities, GetMap, or GetFeatureInfo method call. If a callback function is specified via the CALLBACK_FUNCTION property, it is called in the following circumstances:
All methods invoke the callback function with an array of strings indicating status as the first parameter, an array of integers containing progress information as the second parameter, and with the value (if any) specified by the CALLBACK_DATA property as the third parameter. A callback function returns a value of type Int.
The return value of the callback function should be an integer zero or one. If the return value is zero, a cancel message will be sent to the remote node. If the return value is one, the operation will continue.
A callback function is written in IDL and has the following signature:
Function Callback_Function_Name, StatusInfo, ProgressInfo, CallbackData
where
The CallbackData parameter is useful for passing static information, such as the widget ID of a widget where the status information is displayed or a pointer to a complex data structure, from the IDLnetOGCWMS object to the callback routine.
For a simple example of using a callback to return additional status information, see IDLnetOGCWMS::GetCapabilities. The StatusInfo details are printed to the Output window.
The following sections describe the IDLnetOGCWMS object’s support of HTTP protocols including:
The IDLnetOGCWMS object supports the following HTTP authentication modes for WMS and proxy servers:
By default, AUTHENTICATION and PROXY_AUTHENTICATION properties are set to “Basic and Digest” option, meaning that either basic or digest authentication are supported. However, for this setting to be honored, the corresponding username and password properties must also be set:
The IDLnetOGCWMS object also supports HTTPS through the implementation of Secure Socket Layer (SSL). With SSL encryption, all requests and responses are encrypted. When the URL_SCHEME property is set to “https”, use the SSL_CERTIFICATE_FILE, SSL_VERIFY_HOST, and SSL_VERIFY_PEER properties to define security-related parameters.
Note: If you receive a PRNG (Pseudo Random Number Generator) error when attempting to use HTTPS on UNIX, you need to install either dev/random or dev/urandom in order to generate secure keys.
The IDLnetOGCWMS object supports compressed and encoded responses from a remote OGC WMS server. Supported encoding formats are:
See the ENCODE property for details.